package online.heycm.platform.common.tools.cipher;

import cn.hutool.crypto.symmetric.AES;
import online.heycm.platform.common.tools.cipher.core.AESCore;

/**
 * @author heycm
 * @since 2023/11/19 19:03
 */
public class AESEncrypt {

    private final AES aes;

    public AESEncrypt(AES aes) {
        this.aes = aes;
    }

    public AESEncrypt(String key) {
        aes = AESCore.aes(key);
    }

    public String encrypt(String content) {
        return AESCore.encrypt(this.aes, content);
    }

    public String decrypt(String encrypt) {
        return AESCore.decrypt(this.aes, encrypt);
    }
}
